#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>

</style>
#end

#define content()
<div class="layui-fluid">
    <div class="layui-row">
        <table id="dateTable" lay-filter="dateTable"></table>
    </div>
</div>

<script type="text/html" id="barOption">
    #shiroHasPermission('/app/project/see')
    <a class="layui-btn layui-btn-xs" lay-event="see">查看项目资料</a>
    <a class="layui-btn layui-btn-xs" lay-event="see1">评估详情</a>
    #end
</script>
#end

#define js()
<script type="text/javascript">
    layui.use(['table', 'layer'], function () {
        var table = layui.table;
        var url = "#(url)";
        // 表格渲染
        var tableIns = table.render({
            elem: '#dateTable'                  //指定原始表格元素选择器（推荐id选择器）
            , id: 'dateTable'
            , even: true //开启隔行背景
            , size: 'sm' //小尺寸的表格
            , height: 'full-50'    //容器高度
            , contentType: 'application/json; charset=UTF-8'
            , cols: [[                  //标题栏
                {type: 'numbers', fixed: true, unresize: 'true'}
                , {field: 'name', title: '项目名称', minWidth: 150, sort: true}
                , {field: 'amount', title: '预计金额(单位：元)', width: 160, sort: true, templet: '#tplMoney'}
                , {field: 'site', title: '地址', minWidth: 150}
                , {field: 'brief', title: '简介', minWidth: 150}
                , {field: 'assessmentMode', title: '评估方式', width: 100, sort: true}
                , {field: 'createTime', title: '创建时间', width: 150, sort: true}
                , {field: 'remark', title: '备注', minWidth: 100}
                , {fixed: 'right', title: '操作', minWidth: 190, align: 'center', toolbar: '#barOption'} //这里的toolbar值是模板元素的选择器
            ]]
            , url: '#(ctxPath)/app/project/evaluationTable'
            , method: 'get'
            , page: false
            , loading: true
            , done: function (res, curr, count) {
            }
        });
        table.on('tool(dateTable)', function (obj) {
            var data = obj.data;
            if (obj.event === 'see') {
                 pop_show('查看项目资料', '#(ctxPath)/app/project/see?id=' + data.id, '1200', '750', function () {
                 });
            } else if (obj.event === 'see1') {
                window.location.href = "#(ctxPath)/app/evaluation/evaluationInformation?id=" + data.id;
            }
        });
    });
</script>
<script type="text/html" id="tplMoney">{{formatCurrency(d.amount)}}</script>
#end
